<?php

namespace App\Http\Controllers\Chanjet;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class TplusPurchaseInvoiceInfo extends BaseController
{
    protected static $Field = [
        "voucher_id" => "PurchaseInvoice.ID",
        "voucher_code" => "PurchaseInvoice.Code",
        "voucher_date" => "PurchaseInvoice.VoucherDate",

        "warehouse_name" => "PurchaseInvoice.PurchaseInvoiceDetails.Warehouse.Name",
        "inventory_name" => "PurchaseInvoice.PurchaseInvoiceDetails.Inventory.Name",
        "unit_name" => "PurchaseInvoice.PurchaseInvoiceDetails.Unit.Name",
        "quantity" => "PurchaseInvoice.PurchaseInvoiceDetails.Quantity",
        "taxRate" => "PurchaseInvoice.PurchaseInvoiceDetails.TaxRate",
        "OrigTaxPrice" => "PurchaseInvoice.PurchaseInvoiceDetails.OrigTaxPrice",
        "OrigTaxAmount" => "PurchaseInvoice.PurchaseInvoiceDetails.OrigTaxAmount",

        "steel_factory_name" => "PurchaseInvoice.PurchaseInvoiceDetails.pubuserdefnvc1",
        "material_name" => "PurchaseInvoice.PurchaseInvoiceDetails.pubuserdefnvc2",
        "breed_name" => "PurchaseInvoice.PurchaseInvoiceDetails.pubuserdefnvc3",
        "ts" => "PurchaseInvoice.PurchaseInvoiceDetails.Ts"
        //"archive_spec" => "",
    ];

    /**
     * 列表
     */
    public function getlist(Request $request)
    {

        $memberinfo = $this->mangerinfo;

        $isgetall = $request->isgetall ?? 0;

//        $pid = $request->pid ?? 0;
//        $request
        $list = \App\Models\Chanjet\TplusPurchaseInvoice::getList($request, $memberinfo, $isgetall);


        return response()->json(['code' => '000', 'msg' => '操作成功', 'data' => $list]);
    }
}
